package dk.dtu.is.jjmvcp;
import dk.dtu.is.jjmvcp.controller.MyController;
import dk.dtu.is.jjmvcp.model.MyJavaBeanModel;
import dk.dtu.is.jjmvcp.view.MyView;


/**
 * A simple class to run the MVC in the JAVA environment withoout using JESS. </br></br>
 * 
 * It does pretty much what the userfunction {@link addMVC addMVC} does, i.e. it initializes the model, the view and the controller.
 * 
 * @author dsac
 *
 */
public class runMVC {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// create the MVC
		// create the model - which is java bean
		MyJavaBeanModel myJavaBeanModel = new MyJavaBeanModel();
		// create the view - which is a MyView 
		MyView myView = new MyView();
		// create the controller
		MyController myController = new MyController();
		
		// add the model and the view to the current controller
		myController.addView(myView);
		myController.addModel(myJavaBeanModel);
		// and the controller to the view. I need this to add potential action listener to it.
		// and also add the model to the view. The view will update itself based upon property changes event on the model
		myView.addController(myController);
		myView.addModel(myJavaBeanModel);
	}

}
